<template>
  <div class="bs" style="padding-bottom: 100px">
    <!-- 查询条件 -->
    <Search ref="form" @search="initTable" />
    <!-- table组件 -->
    <MenuTable ref="table" v-loading="loading" :data-list="dataList" @search="initTable" />
  </div>
</template>
<script>
import MenuTable from './components/Table'
import Search from './components/Search'
import api from '@/api/system/menu'
export default {
  components: {
    MenuTable,
    Search
  },
  data() {
    return {
      dataList: [],
      loading: false
    }
  },
  mounted() {
    this.initTable()
  },
  methods: {
    menuInit() {
      this.$nextTick(() => {
        this.$refs.table.$refs.table.doLayout()
      })
    },
    initTable() {
      this.loading = true
      const params = this.$refs.form.query
      api.getMenus({ ...params }).then(res => {
        this.dataList = res.list
        setTimeout(() => {
          this.loading = false
        }, 500)
      }, () => {
        this.loading = false
      })
    }
  }
}
</script>
<style lang="scss" scoped>

</style>
